package com.gzz.orchid.main.console;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

/**
 * @author higmd
 */
@Slf4j
@SpringBootApplication(scanBasePackages = {
        "com.gzz.orchid.main.console"
        , "com.gzz.orchid.context.infrastructure"
        , "com.gzz.orchid.context.domain"
        , "com.gzz.orchid.context.application"
})
@MapperScan("com.gzz.orchid.context.infrastructure.persistence")
public class ConsoleApplication {
    public static void main(String[] args) {
        // 使用自定义的ApplicationContext配置类
        var builder = new SpringApplicationBuilder(ConsoleApplication.class)
                // 确保是Servlet类型应用，如果是REACTIVE则需要调整为WebApplicationType.REACTIVE
                .web(WebApplicationType.SERVLET)
                .run(args);
    }
}